#pragma once
extern "C" {
#include <libswscale/swscale.h>
#include <libavutil/opt.h>
#include <libavutil/imgutils.h>
}
class CSwscale
{
public:
	CSwscale(AVPixelFormat src_pixfmt, int src_w, int src_h, AVPixelFormat dst_pixfmt, int dst_w, int dst_h);
	~CSwscale();
	int scale(const uint8_t *const srcSlice[], const int srcStride[], uint8_t *const dst[], const int dstStride[]);
private:
	struct SwsContext *m_img_convert_ctx;
	//src
	AVPixelFormat m_src_pixfmt;
	int m_src_w;
	int m_src_h;
	//dst
	AVPixelFormat m_dst_pixfmt;
	int m_dst_w;
	int m_dst_h;
};

